package app.fugema.shop.main.evaluate.model;

import com.base.common.utils.UIUtils;

import java.util.ArrayList;
import java.util.List;

public class ProductPostComment
{

    private int ProductId;
    private String ProductName;
    private String imageUrl;

    private String mark;
    private String content;
    private int orderItemId;
    private List<String> images;

    private List<String> imgsPath;

    public int getProductId() {
        return ProductId;
    }

    public void setProductId(int productId) {
        ProductId = productId;
    }

    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getOrderItemId() {
        return orderItemId;
    }

    public void setOrderItemId(int orderItemId) {
        this.orderItemId = orderItemId;
    }

    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public List<String> getImgsPath() {
        return imgsPath;
    }

    public void setImgsPath(List<String> imgsPath) {
        this.imgsPath = imgsPath;
    }



    public static List<ProductPostComment> getProductListByResult(CommentProductResult result)
    {
        List<ProductPostComment> postCommentList = new ArrayList<>();

        if(UIUtils.isNotEmpty( result.getProduct() ) && UIUtils.isNotEmpty( result.getOrderItemIds() ) )
        {
            for( int i=0 ; i < result.getProduct().size();i++ )
            {
                ProductPostComment comment = new ProductPostComment();
                comment.setProductId( result.getProduct().get(i).getProductId() );
                comment.setProductName( result.getProduct().get(i).getProductName() );
                comment.setImageUrl( result.getProduct().get(i).getImage() );
                comment.setOrderItemId( result.getOrderItemIds().get(i) );
                postCommentList.add(comment);
            }
        }
        return postCommentList;
    }

}
